@import '../../../styles/index';

.top-container {
  display: flex;
  margin-bottom: 8px;
  align-items: center;
  justify-content: flex-end;

  >div:last-child {
    top: 44px !important;
    height: calc(100% - 44px);
  }

  :global(.ant-dropdown) {
    top: 0 !important;
    height: 100%;
  }

  :global(.active) {
    color: var(--icon-active);
  }

  :global(.disabled) {
    opacity: 0.7;

    &:hover {
      cursor: not-allowed;
    }
  }

  :global(.icon-add-circle) {
    margin-right: auto;
  }
}

:global(.no-top-padding) {
  .top-container>div:last-child {
    top: 32px !important;
    height: calc(100% - 32px);
  }
}

.active-scene-container {
  margin-right: 4px;
  font-weight: 500;
  font-size: 16px;
  color: var(--title);
  display: flex;
  align-items: center;
  min-width: 0;
  // Fixes long scene collection names still pushing width even with overflow: hidden and text-overflow: ellipsis
  max-width: 30vw;

  &:hover {
    cursor: pointer;
  }
}

.sources-header:extend(.active-scene-container) {
  &:hover {
    cursor: default;
  }
}

.active-scene,
.source-title {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.scenes-container {
  background: var(--section);
  border-radius: 4px;
  height: 100%;

  &:global(.os-host) {
    overflow: hidden !important;
  }

  :global(.ant-tree) {
    background: transparent;
  }

  :global(.ant-tree-switcher) {
    display: none;
  }

  :global(.ant-tree-title) {
    display: block;
    width: 100%;
  }

  :global(.ant-tree-treenode),
  :global(.ant-tree-node-content-wrapper) {
    width: 100%;
    transition: all 0s !important;
    border-radius: 0 !important;
  }

  :global(.ant-tree-treenode) {
    padding: 0 !important;
  }

  :global(.ant-tree-node-content-wrapper) {
    padding-left: 16px !important;
    display: flex;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
  }

  :global(.ant-tree-node-selected) {
    background-color: var(--solid-input) !important;

    :global(.ant-tree-title) {
      color: var(--title);
    }
  }
}

.dropdown-container {
  background: var(--section);
  border: 1px solid var(--border);
  padding: 8px;
  border-radius: 4px;
  height: 100%;

  .whisper {
    font-size: 10px;
    opacity: 0.7;
  }
}

.dropdown-item {
  margin: 4px;
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;

  i {
    margin-right: 4px;
  }

  &:hover {
    color: var(--title);
    cursor: pointer;
  }

  &.os-mismatch {
    opacity: 0.7;

    &:hover {
      cursor: not-allowed;
    }
  }
}

.source-icons {
  display: flex;
  align-items: center;
  margin-right: 16px;

  i {
    margin-left: 8px;
  }
}

.source-title-container {
  display: flex;
  align-items: center;

  >i {
    margin-right: 8px;
    opacity: 0;
  }

  :global(.fa-signal) {
    opacity: 1;
    color: var(--teal);
  }

  :global(.icon-lock),
  :global(.icon-hide),
  :global(.icon-broadcast),
  :global(.icon-studio) {
    opacity: 0.7;
  }

  &:hover {
    i {
      opacity: 1;
    }
  }
}

.source-title {
  margin-right: auto;
}

.sources-container {
  :global(.ant-tree-switcher) {
    width: 0;
    display: flex;
    align-items: center;
    z-index: 1;
    left: 10px;
  }

  :global(.ant-tree-node-content-wrapper) {
    padding-left: 32px !important;
    display: flex;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
  }

  :global(.ant-tree-treenode) {
    padding: 0 !important;
  }

  :global(.ant-tree-title) {
    display: block;
    width: 100%;
  }

  :global(.fa-folder) {
    &:hover {
      &::before {
        content: '\f07c';
      }

      color: var(--title);
    }
  }

  :global(.ant-tree-switcher i) {
    vertical-align: middle;
    // Icomoon icons have needed this all along
    display: inline-block;
  }
}

.tree-mask {
  width: 100%;
  height: 100%;
  z-index: 100;
  position: absolute;
}

.toggle-error {
  padding: 0px !important;
  text-align: unset !important;

  :global(.ant-message-notice-content) {
    padding: 4px 16px;
  }
}

.display-toggle {
  i {
    line-height: unset;
    margin-left: 10px !important;
  }
}
